package com.avocado;

import com.avocado.bt.BTManager;
import com.avocado.bt.BTNodeScan;
import com.avocado.bt.impl.Tree;
import com.avocado.bt.parse.BTParser;

import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

/**
 * @Author: zsh
 * @Date: 2023/10/16 10:08
 */
public class Main {

    public static void main(String[] args) throws NoSuchMethodException {
        BTNodeScan.scan();

        BTParser.parse();

        List<Tree> trees = BTManager.getTrees();

        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                for (Tree tree : trees) {
                    tree.tick();
                }
                System.out.println("---- tick -----");
            }
        }, 0, 1000L);

    }

}